FROM registry-vpc.cn-shanghai.aliyuncs.com/mom2_base/nginx:1.17.5

ENV RUN_GROUP nginx
ENV DATA_DIR /home/www/dist

# 复制源码到容器的/home目录
COPY ./dist /home/www/dist

COPY ./nginx.conf /etc/nginx/nginx.conf

# 大禹系统使用docker目录下的nginx配置
# COPY ./docker/nginx/conf.d/default.conf.template /etc/nginx/conf.d/default.conf.template
# 添加启动脚本
COPY ./docker/nginx/start.sh /etc/nginx/start.sh
# 给脚本赋权限
RUN chmod +x /etc/nginx/start.sh

#  日志的处理
ENV _APP_NAME=flow-platform-web
RUN mkdir /root/app-logs
RUN ln -sf /var/log/nginx/access.log /root/app-logs/${_APP_NAME}-nginx-app.log \
    && ln -sf /dev/stderr /root/app-logs/${_APP_NAME}-nginx-error-app.log

# 指定执行的工作目录
WORKDIR /home/www

EXPOSE 8080

#CMD 运行以下命令
CMD ["sh", "/etc/nginx/start.sh"]
